package main

import (
	"fmt"
	"gitee.com/xxl6097/go-rocketmq/mq"
	"github.com/apache/rocketmq-client-go/v2/primitive"
	"time"
)

var nameserver = "10.6.14.3:9876"
var groupname = "clink-tcp-roketmq"
var topicSubs = "clink-any-to-tcp-topic"
var topicPush = "clink-tcp-to-any-topic"

func main() {
	mqinstance := mq.NewMQ(nameserver, topicSubs, topicPush, groupname, func(msg *primitive.MessageExt) {
		fmt.Printf("---> %v \n", msg)
	})
	for {
		mqinstance.Send("hello world " + time.Now().String())
		time.Sleep(time.Second * 1)
	}
	mqinstance.Shutdown()
}
